package com.hht.kotlineee.viewmodel

import androidx.lifecycle.MutableLiveData
import androidx.lifecycle.ViewModel
import androidx.lifecycle.viewModelScope
import com.hht.kotlineee.net.model.ResponseModel
import com.hht.kotlineee.repository.HomeRepository
import kotlinx.coroutines.launch

class MainViewModel :ViewModel() {

    var banner = MutableLiveData<List<ResponseModel.Banner>?>()
    var homeRepository:HomeRepository = HomeRepository()

    fun getBannerData(){
        viewModelScope.launch {
            var bannerData = homeRepository.getBanner()
            banner.value = bannerData.data
        }
    }

}